//
//  BaseDao.swift
//  DownloadTube
//
//  Created by Carlos on 28/10/14.
//  Copyright (c) 2014 Noname. All rights reserved.
//

import UIKit
import CoreData

class BaseDao: NSObject {
   
    func deleteObject(object: NSManagedObject){
        
        let context = managedObjectContext()
        context.deleteObject(object)
        context.save(nil)
    }
    
    func managedObjectContext() -> NSManagedObjectContext {
        
        var delegate = UIApplication.sharedApplication().delegate as AppDelegate
        var context : NSManagedObjectContext = delegate.managedObjectContext!
        return context;
    }
}
